import HttpService from '../baseHttp'

export const HttpCountryList = (data = {}) => HttpService.get('/commonregions/getAllCountry', { params: data, baseURL: process.env.VUE_APP_APIURL_SHIP })

// 发货地址管理
// export const HttpBillingCategory = (data = {}) => HttpService.get('/api/v2/newBilling/billingCategory/queryAll', { params: data, baseURL: process.env.VUE_APP_APIURL_FBB })
// export const HttpDeleteBillingCategoryOne = (data) => HttpService.post('/api/v2/newBilling/billingCategory/deleteNode', data, { baseURL: process.env.VUE_APP_APIURL_FBB });
// export const HttpSaveBillRuleOne = (data) => HttpService.post('/api/v2/newBilling/billingCategory/saveBillingRule', data, { headers: { "Content-Type": "application/json" } })



export const HttpShipperList = (data) => HttpService.post('/api/jwt/spl/shipper/query', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpSaveShipper = (data) => HttpService.post('/api/jwt/spl/shipper/save', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpShipper = (data) => HttpService.post('/api/jwt/spl/shipper/query_row', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpRecordList = (data) => HttpService.post('/api/jwt/spl/oplog/query', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });



// 发货地址管理-管理端
export const HttpShipperManageList = (data) => HttpService.post('/api/jwt/spl/shipper/queryByManage', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpSaveShipperManage = (data) => HttpService.post('/api/jwt/spl/shipper/saveByManage', data, { headers: { "Content-Type": "application/json"}, baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpSaveControl = (data) => HttpService.post('/api/jwt/spl/shipper/labelLimit', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });


// 收货地址管理
export const HttpReceiverList = (data) => HttpService.post('/api/jwt/spl/receiver/query', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpSaveReceiver = (data) => HttpService.post('/api/jwt/spl/receiver/save', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpReceiver = (data) => HttpService.post('/api/jwt/spl/receiver/query_row', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpDeleteReceiver = (data) => HttpService.post('/api/jwt/spl/receiver/del', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });


// label 获取
export const HttpSaveLabel = (data) => HttpService.post('/api/jwt/spl/shippinginfo/save', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpCreateLabel = (data) => HttpService.post('/api/v2/orderShipment/create', data, { headers: { "Content-Type": "application/json" },baseURL: process.env.VUE_APP_APIURL_SHIP })
export const HttpCalculateLabel = (data) => HttpService.post('/api/v3/orderShipment/calculate', data, { headers: { "Content-Type": "application/json" },baseURL: process.env.VUE_APP_APIURL_SHIP })


export const HttpLabelList = (data) => HttpService.post('/api/jwt/spl/shippinginfo/query', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpLabelDetail = (data) => HttpService.post('/api/jwt/spl/shippinginfo/query_row', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpWaybill = (data) => HttpService.post('/api/jwt/spl/shippinginfo/batchLable', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpBatchWaybill = (data) => HttpService.post('/api/jwt/spl/shippinginfo/batchLable1', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpPrintWaybill = (data,config) => HttpService.post('/api/jwt/spl/shippinginfo/batchPrint', data,config, { baseURL: process.env.VUE_APP_APIURL_SHIP });

// 批量取消，删除，下载

export const HttpBatchCancel = (data) => HttpService.post('/api/jwt/spl/shippinginfo/batchCancel', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpBatchDel = (data) => HttpService.post('/api/jwt/spl/shippinginfo/batchDel', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpBatchLableDownLoad = (data) => HttpService.post('/api/jwt/spl/shippinginfo/batchLableDownLoad', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });

export const HttpCancelWaybill = (data) => HttpService.post('/api/jwt/spl/shippinginfo/cancel', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpRemoveWaybill = (data) => HttpService.post('/api/jwt/spl/shippinginfo/del', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });

// 测算接口
export const HttpCalculatePrice = (data) => HttpService.post('/api/jwt/spl/shippinginfo/calculate', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });



// 账户
//账户概览
export const HttpAccountOverview = (data) => HttpService.post('/api/jwt/spl/useramount/amountOverview', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpAccount = (data) => HttpService.post('/api/jwt/spl/transactionrecord/query', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
// 冻结记录、冻结记录管理
export const HttpFreezeAndUnfreeze = (data) => HttpService.post('/api/jwt/spl/freeze/findByPage', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpManegeFreezeAndUnfreeze = (data) => HttpService.post('/api/jwt/spl/freeze/findByPageManage', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
// 获取账期下拉
export const HttpGetCodeList = (data = {}) => HttpService.get('/api/jwt/spl/freeze/findPeriodByOrg', { params: data, baseURL: process.env.VUE_APP_APIURL_SHIP })
// 生成账单
export const HttpCreateBillFreeze = (data) => HttpService.post('/api/jwt/spl/freeze/createBill', data, { headers: { "Content-Type": "application/json" },baseURL: process.env.VUE_APP_APIURL_SHIP })
// 获取运单记录详情
export const HttpGetBillFreezeDetail = (data = {}) => HttpService.get('/api/jwt/spl/shippinginfo/detail', { params: data, baseURL: process.env.VUE_APP_APIURL_SHIP })



export const HttpAccountTotal = (data) => HttpService.post('/api/jwt/spl/transactionrecord/overview', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpFreezeTotal = (data) => HttpService.post('/api/jwt/spl/transactionrecord/overviewFreezeAndUnfreeze', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
//明细
export const HttpAcountBillList = (data) => HttpService.post('/api/jwt/spl/bill/detail', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpAcountBillSummary = (data) => HttpService.post('/api/jwt/spl/bill/summary', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpAccountBillTotal = (data) => HttpService.post('/api/jwt/spl/bill/totalAmout', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });


// 运单记录管理
export const HttpManageTransation = (data) => HttpService.post('/api/jwt/spl/transactionrecord/queryManage', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });

// 财务管理//AM=account Manger
export const HttpAddAMRecharge = (data) => HttpService.post('/api/jwt/spl/rechargerecord/save', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpAMRechargeList = (data) => HttpService.post('/api/jwt/spl/rechargerecord/query', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });

// 资金Finance
// 冻结
export const HttpFinanceFrozen = (data) => HttpService.post('/api/jwt/spl/freeze/query', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpAddFinanceFrozen = (data) => HttpService.post('/api/jwt/spl/freeze/save', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpUnfrozenFinance = (data) => HttpService.post('/api/jwt/spl/freeze/unFreeze', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });

//解冻
export const HttpFinanceUnfrozen = (data) => HttpService.post('/api/jwt/spl/unfreeze/query', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpAddFinanceUnfrozen = (data) => HttpService.post('/api/jwt/spl/unfreeze/save', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });


//余额
export const HttpFinanceRemaind = (data) => HttpService.post('/api/jwt/spl/useramount/query', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });


//异常单据列表查询
export const HttpAbnormalBill = (data) => HttpService.post('/api/jwt/spl/transactionrecord/queryFreezeAndError', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });

// 处理异常（批量解冻）
export const HttpBatchRefreeze = (data) => HttpService.post('/api/jwt/spl/transactionrecord/batchRefreeze', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });

// 调整单bill
export const HttpBillSummary = (data) => HttpService.post('/api/jwt/spl/adjustment/summary', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpBillList = (data) => HttpService.post('/api/jwt/spl/adjustment/query', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpAddBill = (data) => HttpService.post('/api/jwt/spl/adjustment/save', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });

//客户账单
export const HttpBillCustomer = (data) => HttpService.post('/api/jwt/spl/bill/manage/query', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpBillCustomerDetail = (data) => HttpService.post('/api/jwt/spl/bill/manage/detail', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpConfirmBillCustomer = (data) => HttpService.post('/api/jwt/spl/bill/manage/confirm', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpBillCustomerSummary = (data) => HttpService.post('/api/jwt/spl/bill/manage/totalAmout', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });



// 运单记录-管理
// 列表、查看
export const HttpGetLabelManageList = (data) => HttpService.post('/api/jwt/spl/shippinginfo/manageQuery', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpGetLabelManageOne = (data) => HttpService.post('/api/jwt/spl/shippinginfo/query_row', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });

// 更新物流历史
export const HttpUpdateTrack = (data) => HttpService.post('/api/jwt/spl/shippinginfo/updateTrack', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });

// 获取tab的数字
export const HttpGetCountByStatusNum = (data) => HttpService.post('/api/jwt/spl/shippinginfo/getCountByStatus', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpGetCountManageByStatusNum = (data) => HttpService.post('/api/jwt/spl/shippinginfo/getManageCountByStatus', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });


// 查询物流track的列表接口/管理端
export const HttpSearchTracking = (data) => HttpService.post('/api/jwt/spl/shippinginfo/queryTracking', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });
export const HttpSearchManageTracking = (data) => HttpService.post('/api/jwt/spl/shippinginfo/manageQueryTracking', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });

// 获取创建运单承运商、承运商服务
export const HttpOrderCarrierList = (data = {}) => HttpService.get('/api/jwt/spl/thirdPartyAccount/carriers', { params: data, baseURL: process.env.VUE_APP_APIURL_SHIP })
export const HttpOrderCarrierServiceList = (data = {}) => HttpService.post('/api/jwt/spl/thirdPartyAccount/serviceCodes', data, { baseURL: process.env.VUE_APP_APIURL_SHIP });

//所有承运商
export const HttpCarrierAllList = (data = {}) => HttpService.get('/api/jwt/spl/shipCommon/getCarrier', { params: data, baseURL: process.env.VUE_APP_APIURL_SHIP })
// 查询所有承运商服务
export const HttpCarrierServiceList = (data = {}) => HttpService.get('/api/jwt/spl/shipCommon/getCarrierService', { params: data, baseURL: process.env.VUE_APP_APIURL_SHIP })


// 基础配置接口
export const HttpBaseSettingList = (data = {}) => HttpService.get('/api/v1/UcOrganizationOption/findBillSetting', { params: data, baseURL: process.env.VUE_APP_APIURL_UC })
export const HttpBaseSettingOne = (data = {}) => HttpService.get('/api/v1/UcOrganizationOption/getBillSetting', { params: data, baseURL: process.env.VUE_APP_APIURL_UC })
export const HttpSaveBaseSetting = (data) => HttpService.post('/api/v1/UcOrganizationOption/saveBillSetting', data, { headers: { "Content-Type": "application/json" },baseURL: process.env.VUE_APP_APIURL_UC })

// 差异列表接口
export const HttpLabelDifferenceList = (data = {}) => HttpService.get('/api/v2/freightSettlementDiff/findByPage', { params: data, baseURL: process.env.VUE_APP_APIURL_FBB })
// 差异明细-运单信息
export const HttpLabelDifferenceDetail = (data = {}) => HttpService.get('/api/jwt/spl/shippinginfo/queryByTrackingNo', { params: data, baseURL: process.env.VUE_APP_APIURL_SHIP })
// 差异明细-费用明细
export const HttpLabelDifferenceDetailFee = (data = {}) => HttpService.get('/api/v2/freightSettlementItemDiff/detail', { params: data, baseURL: process.env.VUE_APP_APIURL_FBB })
// 差异明细直接入账
export const HttpDirectCredit = (data = {}) => HttpService.get('/api/v2/freightSettlementItemDiff/intoBill', { params: data, baseURL: process.env.VUE_APP_APIURL_FBB })
// 差异明细忽略
export const HttpIgnoreCredit = (data = {}) => HttpService.get('/api/v2/freightSettlementItemDiff/ignored', { params: data, baseURL: process.env.VUE_APP_APIURL_FBB })

// 发票匹配
export const HttpSettingInvoceList = (data = {}) => HttpService.get('/api/v2/fedexInvoiceCompare/findByPage', { params: data, baseURL: process.env.VUE_APP_APIURL_FBB })

// 物流产品列表
export const HttpCarrierProductList = (data = {}) => HttpService.get('/api/v2/sysCarrierGroup/findList', { params: data, baseURL: process.env.VUE_APP_APIURL_SHIP })
// 物流产品保存
export const HttpCarrierProductSave = (data) => HttpService.post('/api/v2/sysCarrierGroup/saveOne', data, { headers: { "Content-Type": "application/json" },baseURL: process.env.VUE_APP_APIURL_SHIP });
// 物流产品账号列表
export const HttpCarrierAccountList = (data = {}) => HttpService.get('/api/v2/carrierGroupAccounts/findByPage', { params: data, baseURL: process.env.VUE_APP_APIURL_SHIP })
// 物流产品账号详情
export const HttpCarrierAccountDetail = (data = {}) => HttpService.get('/api/v2/carrierGroupAccounts/findOne', { params: data, baseURL: process.env.VUE_APP_APIURL_SHIP })
// 物流产品账号保存
export const HttpCarrierAccountSave = (data) => HttpService.post('/api/v2/carrierGroupAccounts/saveOne', data, {  headers: { "Content-Type": "application/json" }, baseURL: process.env.VUE_APP_APIURL_SHIP });
// 物流产品账号Carrier列表查询接口
export const HttpCarrierList = (data = {}) => HttpService.get('/api/v2/sysCarrier/findList', { params: data, baseURL: process.env.VUE_APP_APIURL_SHIP })
// 物流产品授权服务列表查询接口
export const HttpSysCarrierServiceList = (data = {}) => HttpService.get('/api/v2/sysCarrierService/findList', { params: data, baseURL: process.env.VUE_APP_APIURL_SHIP })
// 物流产品授权服务列表查询接口
export const HttpShipCodeList = (data = {}) => HttpService.get('/api/jwt/spl/shipper/findList', { params: data, baseURL: process.env.VUE_APP_APIURL_SHIP })
// 物流产品删除
export const HttpActiveCarrierProduct = (data = {}) => HttpService.get('/api/v2/sysCarrierGroup/active', { params: data, baseURL: process.env.VUE_APP_APIURL_SHIP })
// 物流产品账号删除
export const HttpDeleteCarrierAccount = (data = {}) => HttpService.get('/api/v2/carrierGroupAccounts/deleteById', { params: data, baseURL: process.env.VUE_APP_APIURL_SHIP })
// 物流产品账号状态变更
export const HttpChangeCarrierAccountStatus = (data = {}) => HttpService.get('/api/v2/carrierGroupAccounts/active', { params: data, baseURL: process.env.VUE_APP_APIURL_SHIP })
// 物流产品新增客户组织下拉列表
export const HttpOrgList = (data = {}) => HttpService.get('/api/v1/Context/organizationClients', { params: {module:'Organization', oid:global.SYSID,...data}, baseURL: process.env.VUE_APP_APIURL_UC })

// 物流产品黑名单列表
export const HttpCarrierServiceBlackList = (data = {}) => HttpService.get('/api/v2/CarrierServiceBlack/findByPage', { params: data, baseURL: process.env.VUE_APP_APIURL_SHIP })
// 物流产品黑名单详情
export const HttpCarrierServiceBlackDetail = (data = {}) => HttpService.get('/api/v2/CarrierServiceBlack/findOne', { params: data, baseURL: process.env.VUE_APP_APIURL_SHIP })
// 物流产品黑名单保存
export const HttpCarrierServiceBlackSave = (data) => HttpService.post('/api/v2/CarrierServiceBlack/saveOne', data, {  headers: { "Content-Type": "application/json" }, baseURL: process.env.VUE_APP_APIURL_SHIP });
// 物流产品黑名单根据客户组织查询仓库
export const HttpGetWarehouseByOrg = (data = {}) => HttpService.get('/api/v2/organizationWarehouse/getCustomerWarehouse', { params: data, baseURL: process.env.VUE_APP_APIURL_FBB })
// 物流产品黑名单根据客户组织查询物流产品
export const HttpGetProductByOrgLabel = (data = {}) => HttpService.get('/syscarriergroup/findByCustomerId', { params: data, baseURL: process.env.VUE_APP_APIURL_SHIP })
// 物流产品黑名单根据客户组织查询承运商服务
export const HttpGetProductServiceByOrg = (data = {}) => HttpService.get('/api/v2/sysCarrierService/findList', { params: data, baseURL: process.env.VUE_APP_APIURL_SHIP })
// 根据物流产品查询物流产品服务
export const HttpGetServiceProductList = (data = {}) => HttpService.get("/api/v2/carrierGroupServiceCode/findByGroupId", { params: data, baseURL: process.env.VUE_APP_APIURL_SHIP });
// 物流产品黑名单切换状态
export const HttpChangeCCarrierServiceBlackStatus = (data = {}) => HttpService.get('/api/v2/CarrierServiceBlack/active', { params: data, baseURL: process.env.VUE_APP_APIURL_SHIP })

// 承运商服务列表
export const HttpCarrierServiceComparisonList = (data = {}) => HttpService.get('/api/v2/sysCarrierService/findByPage', { params: data, baseURL: process.env.VUE_APP_APIURL_SHIP })
// 承运商服务详情
export const HttpCarrierServiceComparisonDetail = (data = {}) => HttpService.get('/api/v2/sysCarrierService/findOne', { params: data, baseURL: process.env.VUE_APP_APIURL_SHIP })
// 承运商服务保存
export const HttpCarrierServiceComparisonSave = (data) => HttpService.post('/api/v2/sysCarrierService/saveOne', data, {  headers: { "Content-Type": "application/json" }, baseURL: process.env.VUE_APP_APIURL_SHIP });
// 承运商服务切换状态
export const HttpChangeCarrierServiceComparisonStatus = (data = {}) => HttpService.get('/api/jwt/spl/shipper/active', { params: data, baseURL: process.env.VUE_APP_APIURL_SHIP })

// 承运商账号列表
export const HttpSysAccountList = (data = {}) => HttpService.get('/api/v2/sysAccount/findByPage', { params: data, baseURL: process.env.VUE_APP_APIURL_SHIP })
// 承运商服务详情
export const HttpSysAccountDetail = (data = {}) => HttpService.get('/api/v2/sysAccount/findOne', { params: data, baseURL: process.env.VUE_APP_APIURL_SHIP })
// 承运商服务详情（脱敏）
export const HttpSysAccountDetailHide = (data = {}) => HttpService.get('/api/v2/sysAccount/getById', { params: data, baseURL: process.env.VUE_APP_APIURL_SHIP })
// 承运商服务保存
export const HttpSysAccountSave = (data) => HttpService.post('/api/v2/sysAccount/saveOne', data, {  headers: { "Content-Type": "application/json" }, baseURL: process.env.VUE_APP_APIURL_SHIP });
// 承运商服务切换状态
export const HttpSysAccountChangeStatus = (data = {}) => HttpService.get('/api/v2/sysAccount/active', { params: data, baseURL: process.env.VUE_APP_APIURL_SHIP })
// 获取账号列表
export const HttpGetSysAccountList = (data = {}) => HttpService.get('/api/v2/sysAccount/findList', { params: data, baseURL: process.env.VUE_APP_APIURL_SHIP })

// 获取客户全部物流产品服务
export const HttpGetCustomServiceProductAllList = (data = {}) => HttpService.get('/api/v2/carrierGroupServiceCode/findAllByCustomerId', { params: {...data, customerId: global.SYSID }, baseURL: process.env.VUE_APP_APIURL_SHIP })
// 运单记录预约取件获取时间和日期
export const HttpCarrierGetDate = (data) => HttpService.post('/api/v2/pickup/availability', data, {  headers: { "Content-Type": "application/json" }, baseURL: process.env.VUE_APP_APIURL_SHIP });
// 运单记录预约取件
export const HttpCarrierPickUP = (data) => HttpService.post('/api/v2/pickup/create', data, {  headers: { "Content-Type": "application/json" }, baseURL: process.env.VUE_APP_APIURL_SHIP });
// 运单记录取消预约
export const HttpCarrierCancelPickUP = (data) => HttpService.post('/api/v2/pickup/cancel', data, {  headers: { "Content-Type": "application/json" }, baseURL: process.env.VUE_APP_APIURL_SHIP });
